SQL by Example by John Russo

SQL by Example by John Russo

Author:John Russo
Language: eng
Format: epub
Publisher: Momentum Press


If we did not follow an order of precedence, we would get different results:

D = true or true and false

D = true and false

D = false

Let’s look at a few more examples.

3.7.1 EXAMPLE 3.6

Management would like a report that will show all shipments that originated in Seattle or Boston. For those shipments that originated in Boston, management only wants to see the ones that had captain 001-24 as the captain. Figure 3.6 shows our query and the results.

Figure 3.6. Query of shipments that originated in Boston and had captain 001-24 as captain.

Notice that the order of precedence dictated that the Boston and capt_id = ‘001-24’ were evaluated first, and then the or was evaluated next.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.